var webpack = require('webpack');
var htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {

	entry: __dirname + "/src/main.js",
	output: {
		// path: __dirname + "/public",
		path: __dirname + "/dist/js",
		filename: "bundle.js"
	},

	module: {
		rules: [
	      {
	        test: /\.json$/,
	        use: 'json-loader'
	      },
	      {
			test: /\.css$/,
			loader: "style-loader!css-loader"
		  }
	    ],
		loaders: [
			{
				test: /\.js$/,
				exclude: /node_modules/,
			    loader: 'babel-loader',
			    /*query: {
			        presets: ['es2015']
		        }*/

			}
		]

	},

	plugins: [
		new webpack.BannerPlugin("XXZFY8版权内容"),
		new htmlWebpackPlugin({
			template: __dirname + "/public/index.html"
		}),
		new webpack.optimize.UglifyJsPlugin()     ///压缩代码一行

	],

	devServer: {
		contentBase: "./public/",
		historyApiFallback: true,
		// inline: true
	}

}